using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class holidayMap : EntityTypeConfiguration<holiday>
    {
        public holidayMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.real_date)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.comment)
                .IsFixedLength()
                .HasMaxLength(50);

            this.Property(t => t.time1)
                .IsFixedLength()
                .HasMaxLength(8)
                .IsRowVersion();

            // Table & Column Mappings
            this.ToTable("holiday");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.date).HasColumnName("date");
            this.Property(t => t.real_date).HasColumnName("real_date");
            this.Property(t => t.comment).HasColumnName("comment");
            this.Property(t => t.time1).HasColumnName("time1");
        }
    }
}
